package com.xiashitech.agent.instrumentation.spring.security.context;

import com.xiashitech.agent.dto.UserRequest;

public class SecurityRequestContext {
    private static ThreadLocal<UserRequest> securityUserRequest = new ThreadLocal();

    public static UserRequest getSecurityUserRequest() {
        return securityUserRequest.get();
    }

    public static void setSecurityUserRequest(UserRequest userRequest) {
        securityUserRequest.set(userRequest);
    }

    public static void refresh() {
        securityUserRequest.set(null);
    }
}
